<div class="section" id="sitemaplist">
	<form action="" name="formlist" id="formlist" method="post">
	<div class="section-title">
		PRODUCT LIST
		<div class="button right">
			<input class="button" value="<?php echo $this->document->text['button_add']?>" type="button" onclick="linkto('<?php echo $insert?>')">
			<input class="button" type="button" name="delete_all" value="<?php echo $this->document->text['button_delete']?>" onclick="deleteList()"/>  
             <input type="button" onclick="window.close()" class="button" value="<?php echo $this->document->text['button_cancel']?>">
		</div>
		<div class="clearer">^&nbsp;</div>
	</div>
    
    <div class="section-content">
    	<div>
			<p>
				<b><?php echo $this->document->text['text_productgroup']?> : </b><select name="search_productgroup" style="width:200px"><?php echo $cb_productgroup?></select>	
				&nbsp;&nbsp;&nbsp;
				<b><?php echo $this->document->text['text_datafield']?> : </b><select name="search_datafield" style="width:200px"><?php echo $cb_datafield?></select>&nbsp;
				<b><?php echo $this->document->text['text_datavalue']?> : </b><input class="text" type="text" id="search_datavalue" name="search_datavalue" value="<?php echo $search_datavalue?>" size="20" />
			</p>
			<p>			
				<b><?php echo $this->document->text['text_numberfield']?> : </b><select name="search_numberfield" style="width:200px"><?php echo $cb_numberfield?></select>&nbsp;
				<select name="search_function" style="width:200px"><?php echo $cb_function?></select>&nbsp;
				<b><?php echo $this->document->text['text_numbervalue']?> : </b><input class="text" type="text" id="search_numbervalue" name="search_numbervalue" value="<?php echo $search_numbervalue?>" size="10" />
				<input class="button" type="submit" name="search" value="<?php echo $this->document->text['button_search']?>" />
				<input class="button" type="button" name="resetsearch" id="resetsearch" value="<?php echo $this->document->text['button_showall']?>" />
			</p>
		</div>
		
		<div class="sitemap treeindex">
			<table class="data-table" cellpadding="0" cellspacing="0">
			<tbody>
				<tr class="tr-head">
					<th width="1%"><input class="inputchk" type="checkbox" onclick="$('input[name*=\'delete\']').attr('checked', this.checked);"></th>
					<th width="5%">..</th>
					<th width="5%"><?php echo $this->document->text['button_id']?></th>
					<th width="24%"><?php echo $this->document->text['button_name']?></th>
					<th width="10%"><?php echo $this->document->text['text_barcode']?></th>
					<th width="20%"><?php echo $this->document->text['text_groupline1']?></th>  
					<th width="8%"><?php echo $this->document->text['text_sallingprice']?></th>  
					<th width="8%"><?php echo $this->document->text['text_qty']?></th>                                    
				</tr>
	
	
	<?php
		foreach($products as $product)
		{
	?>
				<tr>
					<td class="check-column"><input class="inputchk" type="checkbox" name="delete[<?php echo $product['productid']?>]" value="<?php echo $product['productid']?>" ></td>
					<td class="link-control">
						<a class="button" href="<?php echo $product['link_edit']?>" title="<?php echo $product['text_edit']?>"><?php echo $this->document->text['button_edit']?></a>
					</td>
					<td><?php echo $product['productid']?></td>
					<td><?php echo $product['productname']?></td>
					<td style="text-align:right"><?php echo $product['barcode']?></td>
					<td><?php echo $product['groupname'].'/'.$product['line1']?></td>
					<td style="text-align:right"><?php echo $product['saleprice']?></td>
					<td style="text-align:right"><?php echo $product['instock']?></td>
				</tr>
	<?php
		}
	?>
					
												
			</tbody>
			</table>
		</div>
        
    </div>
    </form>
</div>
<script language="javascript">
function deleteList()
{
	$.post("?route=category/product/delete", 
			$("#formlist").serialize(), 
			function(data)
			{
				if(data!="")
				{
					alert(data)
					linkto("?<?php echo $refres?>")
				}
			}
	);
}

$(document).ready(function(){
	$("#resetsearch").click(function(){
		linkto("index.php?route=category/product");
	});
})
</script>
